/* Get System Time */

var mytimer = function() {
	var now = new Date();
		hour = now.getHours();
		hour = checkTime(hour);
		minute = now.getMinutes();
		minute = checkTime(minute);
		second = now.getSeconds();
		second = checkTime(second);

	$("#clock").text(hour+":"+minute+":"+second);
	//document.getElementById("clock").innerHTML = hour+":"+minute+":"+second;

	// setTimeout(mytimer, 300);
	setTimeout('mytimer()', 300);
}

var checkTime = function(i) {
//function checkTime(i) {
	return i < 10 ? "0"+i : i;
}

// 只能在最后，不能在 mytimer 之前调用，我认为原因是代码未载入完毕??
$(mytimer);
